package com.leo.demo;

import com.alibaba.fastjson.JSONObject;
import com.leo.demo.json.GetOrderStatusAllDetail;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * 类描述
 *
 * @author razor.liu
 * @version 1.0
 * @date 2021/8/11 7:19 下午
 */
public class MainTest {

    public static final String PATTERN_yyyy_MM_dd_HHmmss = "yyyy-MM-dd HH:mm:ss";

    static SimpleDateFormat formatter = new SimpleDateFormat(PATTERN_yyyy_MM_dd_HHmmss);

    private static final Map<String,String> TYPE_MAP = new HashMap<>();

    public static void main(String[] args) {
        List<BillItem> billItemList = new ArrayList<>();
        billItemList.add(new BillItem(1,1));
        billItemList.add(new BillItem(2,1));
        billItemList.add(new BillItem(4,1));
        billItemList.add(new BillItem(3,1));

        System.out.println(JSONObject.toJSONString(billItemList));
        billItemList.sort(new Comparator<BillItem>() {
            @Override
            public int compare(BillItem o1, BillItem o2) {
                return o2.getPaidPriceFen()-o1.getPaidPriceFen();
            }
        });
        System.out.println(JSONObject.toJSONString(billItemList));
    }
}
